package com.simple.elpmobile.onlinecase.ui.base;

import com.simple.elpmobile.onlinecase.engine.AppEngine;
import com.simple.elpmobile.onlinecase.engine.IManager;
import com.simple.elpmobile.onlinecase.engine.manager.ActivityManager;
import com.simple.elpmobile.onlinecase.message.IMessageHandler;

import android.app.Activity;
import android.os.Bundle;
import android.os.Message;

public abstract class BaseActivity  extends Activity implements IMessageHandler {
	// 欢迎页面
	public final static byte SPLASH_ID = 0;

	public final static byte LOGIN_ID = 1;
	// 登陆页面
	public final static byte MAIN_ID = 2;

	
	private boolean mAddToMessageCenter=false;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}	
	

	@Override
	protected void onResume() {
		super.onResume();
		((ActivityManager) AppEngine.getInstance().getManager(
				IManager.ACTIVITY_ID)).pushActivity(this);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		((ActivityManager) AppEngine.getInstance().getManager(
				IManager.ACTIVITY_ID)).removeActivity(this);
	}

	/**
	 * 来电处理
	 */
	public void onPhoneCall() {

	}

	/**
	 * 挂断处理
	 */
	public void onHangUp() {

	}

	/**
	 * 返回页面唯一ID，以供管理和缓存
	 * 
	 * @return 页面ID
	 */
	public abstract byte activityId();
	
	
	/**
	 * 处理activity之间的通信
	 */
	@Override
	public void onHandleMessage(Message msg) {
		// TODO Auto-generated method stub
		
	}
}